var main = new Vue({
	el: '#main',
	data: {
		loading:'',
		pagNamb:0,
		titles:["未完成","已完成","全部"],
		isActive:1,
		response: [],
		ios:iosipone,
		ip:localStorage.ip,
		acceptGender: JSON.parse(localStorage.user_info || "{}").gender, //性别
		acceptIcon:JSON.parse(localStorage.user_info||"{}").headIcon || "",//头像
	},
	methods: {
		listtoggle: function(n) {
			this.isActive = n;
			this.response.length=0;
			this.loading='';
			jiazai(n)
		},
		openurl:function(item,status_style){
			item.status_style=status_style
			sessionStorage.yihu_detail=JSON.stringify(item)
			window.location.href='details.html';
		},
		onScroll:function(ref){
			if(this.$refs[ref].scrollTop+this.$refs[ref].clientHeight >= this.$refs[ref].scrollHeight-2){
				if(this.isActive == 1){
					jiazai("1",this.pagNamb)
				}else if(this.isActive == 2){
					jiazai("2",this.pagNamb)
				}else if(this.isActive == 3){
					jiazai("3",this.pagNamb)
				}
			}
		},
		openloading:function(jingdu,weidu,name){
			showLoading()
			var jingwei={
				jingdu:jingdu,
				weidu:weidu,
				name:name
			}
			sessionStorage.gaode=JSON.stringify(jingwei)
		},
		telipon:function(ipon){
			console.log("调用iOS方法"+ipon)
			secondClick(ipon)
		}
	}
})
//if(iosipone){
//	main.ios =true;
//}
function jiazai(type,pageNo){
	if(!main.loading){
		main.loading="正在加载 . . .";
		ajaxGet(
			Url.ASSESS_MEDICAL,
			{
				"pageNo":pageNo||'0',
				"pageSize":"10",
				"type":type,
				"nub":parseInt(Math.random()*100000)
			},
			function(data){
				if(data.status==1){
					main.pagNamb+=1;
					if(data.response.length == 0 || data.response.length<10){
						main.loading="没有更多了。。。"
					}else{
						main.loading='';
					}
					for(var i=0;i<data.response.length;i++){
						main.response.push(data.response[i])
					}
				}else{
					main.loading="";
				}
			},
			function(){
				main.loading="";
			}
		)
	}
}
jiazai(1);
document.getElementById("main").setAttribute("style","display: block;");